<template>
  <div class="content">
    <div class="header">
      上下班时间
      <a href="" class="more">新增</a>
    </div>
    <div class="body">
      <div v-for="(item, index) in cycleList" :key="index" class="item">
        <span class="text">{{ item.name }}</span>
        <span class="time">
          {{ item.appearanceTime }}
        </span>
        <span class="text">
          <!-- 班组名称 -->
          {{ item.teamIds }}
        </span>
      </div>
    </div>
  </div>
</template>

<script>
import { cycleListData } from '@/api/autonym'
export default {
  data() {
    return {
      cycleList: [],
      listQuery: {
        keyword: null,
        pageNum: 1,
        pageSize: 3
      }
    }
  },
  created() {},
  mounted() {
    this.getCycleList()
  },
  methods: {
    async getCycleList() {
      const res = await cycleListData(this.listQuery)
      if (res.code === 200) {
        if (res.data) {
          this.cycleList = res.data.list.slice(0, 3)
        }
      }
    }
  }
}
</script>

<style scoped lang="scss">
.content {
  width: 100%;
  border-radius: 2px;
  padding: 0 20px 0 40px;
  border-left: 1px solid rgba(221, 221, 221, 0.2);
  .header {
    color: white;
    margin-bottom: 50px;
    .more {
      float: right;
      color: rgba(247, 181, 0, 1);
    }
  }
  .body {
    .item {
      display: flex;
      padding-bottom: 50px;
      .time {
        flex: 1;
        text-align: center;
      }
    }
  }
}
</style>
